#ifndef _bluetooth_h
#define _bluetooth_h

#include "zf_common_headfile.h"


#define RC_UART           UART_5 
#define RC_UART_TX        UART5_TX_A4
#define RC_UART_RX        UART5_RX_A5
#define RC_UART_PRIORITY  UART5_IRQn

typedef struct bluetooth 
{
    uint8 STATE;
    uint8 action;
    uint8 rx[4];                        
    vuint8 i;                           
} BLUETOOTH;

enum
{
    RC_stop = 0x00, RC_auto, RC_remote,
    RC_gyro_init = 0x10,RC_exp_right, RC_exp_left, RC_right_90, RC_left_90, 
    RC_get_dot = 0x20, RC_auto_get
};


typedef struct sbusStruct 
{
    uint8 rx[26]; 
    uint16 CH[18];
    vuint8 i;                           
} SbusStruct;


extern BLUETOOTH RC;
extern SbusStruct SBUS;

void Bluetooth_init(BLUETOOTH* RC);
void get_Bluetooth(uart_index_enum uartn, BLUETOOTH* RC);
void RC_parsing(BLUETOOTH* RCData);

void Sbus_get(uart_index_enum uartn, SbusStruct* sbusData);
void Sbus_Data_Count(SbusStruct* sbusData);
void sbus();

#endif  

